package iwpl.project.entities;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Contracts entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Contracts")
public class Contracts implements java.io.Serializable {

	// Fields

	private Integer id;
	private Apartments apartments;
	private Employees employees;
	private Integer contractType;
	private Timestamp signingDate;
	private Timestamp hiringDate;
	private Timestamp endDate;
	private Timestamp purchaseDate;
	private Timestamp receivedOfDate;

	// Constructors

	/** default constructor */
	public Contracts() {
	}

	/** minimal constructor */
	public Contracts(Integer id) {
		this.id = id;
	}

	/** full constructor */
	public Contracts(Integer id, Apartments apartments, Employees employees,
			Integer contractType, Timestamp signingDate, Timestamp hiringDate,
			Timestamp endDate, Timestamp purchaseDate, Timestamp receivedOfDate) {
		this.id = id;
		this.apartments = apartments;
		this.employees = employees;
		this.contractType = contractType;
		this.signingDate = signingDate;
		this.hiringDate = hiringDate;
		this.endDate = endDate;
		this.purchaseDate = purchaseDate;
		this.receivedOfDate = receivedOfDate;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ApartmentID")
	public Apartments getApartments() {
		return this.apartments;
	}

	public void setApartments(Apartments apartments) {
		this.apartments = apartments;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "EmployeeID")
	public Employees getEmployees() {
		return this.employees;
	}

	public void setEmployees(Employees employees) {
		this.employees = employees;
	}

	@Column(name = "ContractType")
	public Integer getContractType() {
		return this.contractType;
	}

	public void setContractType(Integer contractType) {
		this.contractType = contractType;
	}

	@Column(name = "SigningDate", length = 16)
	public Timestamp getSigningDate() {
		return this.signingDate;
	}

	public void setSigningDate(Timestamp signingDate) {
		this.signingDate = signingDate;
	}

	@Column(name = "HiringDate", length = 16)
	public Timestamp getHiringDate() {
		return this.hiringDate;
	}

	public void setHiringDate(Timestamp hiringDate) {
		this.hiringDate = hiringDate;
	}

	@Column(name = "EndDate", length = 16)
	public Timestamp getEndDate() {
		return this.endDate;
	}

	public void setEndDate(Timestamp endDate) {
		this.endDate = endDate;
	}

	@Column(name = "PurchaseDate", length = 16)
	public Timestamp getPurchaseDate() {
		return this.purchaseDate;
	}

	public void setPurchaseDate(Timestamp purchaseDate) {
		this.purchaseDate = purchaseDate;
	}

	@Column(name = "ReceivedOfDate", length = 16)
	public Timestamp getReceivedOfDate() {
		return this.receivedOfDate;
	}

	public void setReceivedOfDate(Timestamp receivedOfDate) {
		this.receivedOfDate = receivedOfDate;
	}

}